#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
	int year = 0;
	int month = 0;
	int date = 0;
	int year_s = 0;
	int month_s = 0;
	int date_s = 0;
	int flag = 1;
	scanf("%d %d %d", &year, &month, &date);
	scanf("%d %d %d", &year_s, &month_s, &date_s);

	if ((year == year_s) && (month == month_s) && (date <= date_s))
	{
		printf("yes");
	}
	else if ((year == year_s) && (month <= month_s))
	{
		printf("yes");
	}
	else if (year <= year_s)
	{
		printf("yes");
	}
	else
	{
		printf("no");
	}
	return 0;
}